<html>
<head><meta charset="utf-8"><title>RLS 1.0 -- RLS 2.0 bridge · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html">RLS 1.0 -- RLS 2.0 bridge</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="163575844"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163575844" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163575844">(Apr 17 2019 at 16:12)</a>:</h4>
<p>ping <span class="user-mention" data-user-id="153740">@Igor Matuszewski</span></p>



<a name="163576443"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576443" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576443">(Apr 17 2019 at 16:19)</a>:</h4>
<p>So, I think that we can make a relatively easy bridge between <strong>current</strong> architecture of RLS and RLS2</p>



<a name="163576477"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576477" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576477">(Apr 17 2019 at 16:19)</a>:</h4>
<p>The problem is that it'll work only for <strong>current</strong> arch which works via save-analysis</p>



<a name="163576565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576565">(Apr 17 2019 at 16:20)</a>:</h4>
<p>And it wouldn't be transferable to querying compiler's front-end bits</p>



<a name="163576630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576630">(Apr 17 2019 at 16:20)</a>:</h4>
<p>On the high-level, current RLS does two things:</p>
<ul>
<li>it calls rustc in just the right way to produce save-analysis</li>
<li>it transforms save-analysis results into LSP</li>
</ul>



<a name="163576686"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576686" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576686">(Apr 17 2019 at 16:21)</a>:</h4>
<p>The reason why we can't just plug it into rust-analyzer is that RLS uses #[rustc_private], and I believe that RA should be built on stable</p>



<a name="163576760"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576760" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576760">(Apr 17 2019 at 16:22)</a>:</h4>
<p>so we might use something out of process to generate JSON blobs</p>



<a name="163576765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576765">(Apr 17 2019 at 16:22)</a>:</h4>
<p>which we can then load and lower using stable toolchain</p>



<a name="163576769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576769">(Apr 17 2019 at 16:22)</a>:</h4>
<p>is that what you're suggesting?</p>



<a name="163576770"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576770" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576770">(Apr 17 2019 at 16:22)</a>:</h4>
<p>However, if rustc is not in process, and we communicate with it via IPC, that could work</p>



<a name="163576778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576778">(Apr 17 2019 at 16:22)</a>:</h4>
<p>yeah, precisely</p>



<a name="163576802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576802">(Apr 17 2019 at 16:22)</a>:</h4>
<p>so essentially 'stabilize' (as in make it build on stable) rls-data/rls-analysis and work from there</p>



<a name="163576830"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576830" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576830">(Apr 17 2019 at 16:23)</a>:</h4>
<p>sort of</p>



<a name="163576838"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576838" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576838">(Apr 17 2019 at 16:23)</a>:</h4>
<p>there's a small caveat - we use rustc_serialize</p>



<a name="163576868"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576868" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576868">(Apr 17 2019 at 16:23)</a>:</h4>
<p>rustc_serialize is totally usable from stable</p>



<a name="163576871"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576871" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576871">(Apr 17 2019 at 16:23)</a>:</h4>
<p>and rustc_serialize and libserialize on <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> diverged slightly, especially wrt <code>PathBuf</code> handling</p>



<a name="163576894"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576894" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576894">(Apr 17 2019 at 16:23)</a>:</h4>
<p>or was it completely removed?</p>



<a name="163576922"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163576922" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163576922">(Apr 17 2019 at 16:24)</a>:</h4>
<p>hm, need to make sure if we use libserialize in librustc_save_analysis</p>



<a name="163577020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577020">(Apr 17 2019 at 16:24)</a>:</h4>
<p>ah hm so we're using <a href="http://crates.io" target="_blank" title="http://crates.io">crates.io</a> rustc-serialize it seems inside the librustc_save_analysis</p>



<a name="163577027"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577027" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577027">(Apr 17 2019 at 16:24)</a>:</h4>
<p>so there's hope IIUC!</p>



<a name="163577068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577068">(Apr 17 2019 at 16:25)</a>:</h4>
<p>well, at work, we can read json to string and thrown regexes onto it /s</p>



<a name="163577086"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577086" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577086">(Apr 17 2019 at 16:25)</a>:</h4>
<p>that is, this seems surmountable</p>



<a name="163577151"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577151" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577151">(Apr 17 2019 at 16:26)</a>:</h4>
<p>but fair, assuming we get into a somewhat stable deserializable data format for SA, I believe we're good to go</p>



<a name="163577152"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577152" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577152">(Apr 17 2019 at 16:26)</a>:</h4>
<p>The bigger problem here is that we should make the data format itself stable</p>



<a name="163577174"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577174" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577174">(Apr 17 2019 at 16:26)</a>:</h4>
<p>Like, it should be at least de-facto stable, such that different nightlies work</p>



<a name="163577178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577178">(Apr 17 2019 at 16:26)</a>:</h4>
<p>tbf I think we should just version the format with Rust minor edition and make it not backwards-compatible</p>



<a name="163577189"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577189" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577189">(Apr 17 2019 at 16:26)</a>:</h4>
<p>(we can future proof here by making everything optional, etc, protobuf style)</p>



<a name="163577191"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577191" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577191">(Apr 17 2019 at 16:26)</a>:</h4>
<p>hm</p>



<a name="163577208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577208">(Apr 17 2019 at 16:27)</a>:</h4>
<p>and yeah, version numbers totally would help here</p>



<a name="163577234"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577234" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577234">(Apr 17 2019 at 16:27)</a>:</h4>
<p>However, I am not sure if we want to make it formally stable</p>



<a name="163577319"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577319" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577319">(Apr 17 2019 at 16:28)</a>:</h4>
<p>Like, if people depend on it, we'll have to maintain it forever, etc</p>



<a name="163577352"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577352" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577352">(Apr 17 2019 at 16:28)</a>:</h4>
<p>no I don't think so</p>



<a name="163577356"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577356" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577356">(Apr 17 2019 at 16:28)</a>:</h4>
<p>I  think it's ok to make semver-exeption in this case and require some awful flags/env-vars to activate this, a-la RUSTC_BOOTSTRAP</p>



<a name="163577369"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577369" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577369">(Apr 17 2019 at 16:28)</a>:</h4>
<p>if anything, something more akin to LSIF should be 'stable'</p>



<a name="163577412"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577412" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577412">(Apr 17 2019 at 16:29)</a>:</h4>
<p>then there's the question of memory usage</p>



<a name="163577419"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577419" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577419">(Apr 17 2019 at 16:29)</a>:</h4>
<p>IIRC you're fighting with it</p>



<a name="163577447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577447">(Apr 17 2019 at 16:29)</a>:</h4>
<p>and... it's not going to get better if we decide to plug in SA on top of RLS 2.0</p>



<a name="163577463"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577463" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577463">(Apr 17 2019 at 16:29)</a>:</h4>
<p>yeah, that's my point: we <strong>do</strong> want some form of save-analysis long-term: it'll be hugely useful for non-interactive  usages, but we <strong>don't</strong> want current form</p>



<a name="163577545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577545">(Apr 17 2019 at 16:30)</a>:</h4>
<p>Is SA that big?</p>



<a name="163577580"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577580" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577580">(Apr 17 2019 at 16:30)</a>:</h4>
<p>I feel that by implementing <code>SourceManager</code>,  we should be able to drastically cut the memory usage of analyzer</p>



<a name="163577590"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577590" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577590">(Apr 17 2019 at 16:30)</a>:</h4>
<p>well for one I believe rustc_serialization takes ~35 megs of json blob for primary package jsons</p>



<a name="163577626"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577626" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577626">(Apr 17 2019 at 16:31)</a>:</h4>
<p>which is transformed into 6-10 megs worth of hash map data - can't recall if that's only for primary crates or for the entirety of rls-analysis</p>



<a name="163577649"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577649" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577649">(Apr 17 2019 at 16:31)</a>:</h4>
<p>and I feel like we could have a flag for enabling <code>save-analysis</code>, on by default. SO you'll get good experience for small projects, but, for bigger proejcts and smaller ram, you can live only with analyzer parts</p>



<a name="163577655"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577655" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577655">(Apr 17 2019 at 16:31)</a>:</h4>
<p>this is just order of magnitude measure, would have to measure precisely again what's done what</p>



<a name="163577704"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577704" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577704">(Apr 17 2019 at 16:32)</a>:</h4>
<p>heh, 35megs is peanuts, in ra we have GIGs of trees ;(</p>



<a name="163577718"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577718" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577718">(Apr 17 2019 at 16:32)</a>:</h4>
<p><span aria-label="point up" class="emoji emoji-1f446" role="img" title="point up">:point_up:</span> I think that would be ideal</p>



<a name="163577731"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577731" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577731">(Apr 17 2019 at 16:32)</a>:</h4>
<p>damn that's... a lot</p>



<a name="163577736"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577736" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577736">(Apr 17 2019 at 16:32)</a>:</h4>
<p>wouldn't have expected that much</p>



<a name="163577752"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577752" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577752">(Apr 17 2019 at 16:32)</a>:</h4>
<div class="codehilite"><pre><span></span>workspaces:
411 packages loaded

analysis:
28122 (106mb) files
131239 (11mb) symbols
1175 trees, 80 (43mb) retained


memory:
342mb allocated 1499mb resident
gc 852 seconds ago
</pre></div>



<a name="163577755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577755">(Apr 17 2019 at 16:32)</a>:</h4>
<p>is it due to expansion? do we hold separate instance per expansion pass  for macros?</p>



<a name="163577769"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577769" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577769">(Apr 17 2019 at 16:32)</a>:</h4>
<p>well, actually it did get better after gc and rowan work</p>



<a name="163577778"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577778" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577778">(Apr 17 2019 at 16:32)</a>:</h4>
<p>this is from rustc</p>



<a name="163577859"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577859" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577859">(Apr 17 2019 at 16:33)</a>:</h4>
<blockquote>
<p>is it due to expansion? </p>
</blockquote>
<p>I think this is mostly due to poor GC for syntax trees. We never need to keep many syntax trees in memory simultaneously, but currently we do ;(</p>



<a name="163577933"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577933" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577933">(Apr 17 2019 at 16:34)</a>:</h4>
<p>And yeah, limiting memory usage is an absolute blocker for any real release of ra</p>



<a name="163577958"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577958" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577958">(Apr 17 2019 at 16:34)</a>:</h4>
<p>So, I think we can deal with quirky JSON and megabyes of data</p>



<a name="163577986"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163577986" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163577986">(Apr 17 2019 at 16:35)</a>:</h4>
<p>The stability issue is what worries me most</p>



<a name="163578040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163578040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163578040">(Apr 17 2019 at 16:35)</a>:</h4>
<p>Do you think it would be feasible to make save-analysis data "stable, but only for RLS"? <code>struct rustc { friend class RLS; };</code> basically</p>



<a name="163578501"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163578501" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163578501">(Apr 17 2019 at 16:41)</a>:</h4>
<p>The same "stability loophole" would be required for IPC VFS bit as well.</p>



<a name="163578571"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163578571" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163578571">(Apr 17 2019 at 16:42)</a>:</h4>
<p>Hm, otoh, for the poc, we can totally restrict ourselves to nightly, to just test out if it work</p>



<a name="163578640"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163578640" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163578640">(Apr 17 2019 at 16:43)</a>:</h4>
<p>that is, save-analysis bits would be available only on nightly <code>rustc</code>, and we'll use <code>-Z</code> flags to access JSON &amp; VFS</p>



<a name="163579131"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579131" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579131">(Apr 17 2019 at 16:48)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> that's how we currently work around this in stable toolchain</p>



<a name="163579166"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579166" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579166">(Apr 17 2019 at 16:49)</a>:</h4>
<p>we have a <code>rls-rustc</code> shim which is able to run on stable but can emit save-analysis</p>



<a name="163579178"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579178" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579178">(Apr 17 2019 at 16:49)</a>:</h4>
<p>as in, it doesn't require <code>-Z</code> flag</p>



<a name="163579208"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579208" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579208">(Apr 17 2019 at 16:49)</a>:</h4>
<p>for one I'd like to stop using rustc_serialize for save-analysis as a cleanup</p>



<a name="163579286"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579286" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579286">(Apr 17 2019 at 16:50)</a>:</h4>
<p>IIRC there was a problem with serde being in the sysroot which cause some problems, don't know the details</p>



<a name="163579325"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579325" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579325">(Apr 17 2019 at 16:50)</a>:</h4>
<p><a href="#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler" title="#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler</a></p>



<a name="163579377"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579377" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579377">(Apr 17 2019 at 16:51)</a>:</h4>
<p>yeah, purging rustc_serialize from rustc would be awesome</p>



<a name="163579382"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579382" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579382">(Apr 17 2019 at 16:51)</a>:</h4>
<p>If we have an easily serde-deserializable data we can then toy with making it work on stable and so forth</p>



<a name="163579423"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579423" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579423">(Apr 17 2019 at 16:51)</a>:</h4>
<p>I don't think that's feasible since there are some edge cases (metadata serialization) where it'd require more work to make serde support a very niche case</p>



<a name="163579462"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579462" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579462">(Apr 17 2019 at 16:52)</a>:</h4>
<p>but at least for JSON (de)serialization we should definitely switch to serde</p>



<a name="163579549"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579549" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579549">(Apr 17 2019 at 16:53)</a>:</h4>
<p>I guess pigging-in serde should help with perf in that we could switch from JSON to bincode</p>



<a name="163579555"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579555" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579555">(Apr 17 2019 at 16:53)</a>:</h4>
<p>to save memory</p>



<a name="163579630"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579630" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579630">(Apr 17 2019 at 16:54)</a>:</h4>
<p>might be useful for "stability" as well: it's much easier to use JSON accidentally, than with some binary blob of whatever</p>



<a name="163579689"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579689" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579689">(Apr 17 2019 at 16:55)</a>:</h4>
<p>using binary format is also high on the list of things to experiment with for RLS 1.0 so that'd be good as well</p>



<a name="163579733"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579733" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579733">(Apr 17 2019 at 16:56)</a>:</h4>
<p>I'd like to take a look at the higher-level picture here</p>



<a name="163579788"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579788" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579788">(Apr 17 2019 at 16:56)</a>:</h4>
<p>moving rustc out of RLS process does seem like a step backwards</p>



<a name="163579840"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579840" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579840">(Apr 17 2019 at 16:57)</a>:</h4>
<p>However it probably isn't: save-analysis just looks like a less than ideal interface between compiler and IDE, and hiding it behind a query, as far as I understand, won't change the picture drastically</p>



<a name="163579952"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579952" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579952">(Apr 17 2019 at 16:58)</a>:</h4>
<p>yes, we talked about this with Niko as well</p>



<a name="163579967"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579967" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579967">(Apr 17 2019 at 16:58)</a>:</h4>
<p>I believe that we should pursue this as a next step, at least for the 1.0 version</p>



<a name="163579996"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163579996" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163579996">(Apr 17 2019 at 16:59)</a>:</h4>
<p>This = ?</p>



<a name="163580034"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580034" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580034">(Apr 17 2019 at 16:59)</a>:</h4>
<p>moving rustc out of RLS process</p>



<a name="163580089"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580089" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580089">(Apr 17 2019 at 17:00)</a>:</h4>
<p>and just preparing to serve save-analysis or <em>some</em> data back from this <em>analysis rustc</em> invocation</p>



<a name="163580155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580155">(Apr 17 2019 at 17:01)</a>:</h4>
<p>so, it seems like we should just do it?</p>
<ul>
<li>we make rustc better by killing rustc_serialize</li>
<li>we make existing RLS easier to maintain</li>
<li>we provide foundation for 1=2 merger</li>
</ul>



<a name="163580169"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580169" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580169">(Apr 17 2019 at 17:01)</a>:</h4>
<p>1 &amp; 2 seems like no-brainer wins</p>



<a name="163580285"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580285" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580285">(Apr 17 2019 at 17:03)</a>:</h4>
<p>one bit I am worried about is perf... But looks like IPC overhead is just negligible in comparison to actual data processing?</p>



<a name="163580303"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580303" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580303">(Apr 17 2019 at 17:03)</a>:</h4>
<p>again, we can't really <em>kill</em> rustc_serialize as it will be used in rustc for metadata serialization from what I know</p>



<a name="163580306"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580306" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580306">(Apr 17 2019 at 17:03)</a>:</h4>
<p>actually, I was pleasantly surprised by just how fast cargo-watch in ra turns out in practice, especially after @<strong>_Edwin Cheng</strong> 's refactoring</p>



<a name="163580361"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580361" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580361">(Apr 17 2019 at 17:04)</a>:</h4>
<p>but it'd be nice to just push it into a corner and use it only for the niche case needed by rustc</p>



<a name="163580378"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580378" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580378">(Apr 17 2019 at 17:04)</a>:</h4>
<p>Hm, curious, why it is needed for metadata serialization?</p>



<a name="163580384"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580384" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580384">(Apr 17 2019 at 17:04)</a>:</h4>
<p>the format is unstable, so we can change it to something more easily serdable?</p>



<a name="163580394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580394">(Apr 17 2019 at 17:04)</a>:</h4>
<p>not really sure, I'm sure eddy knows more details</p>



<a name="163580401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580401">(Apr 17 2019 at 17:05)</a>:</h4>
<p>but it came up once or twice</p>



<a name="163580445"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580445" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580445">(Apr 17 2019 at 17:05)</a>:</h4>
<p>seemed like it'd be more work to shoehorn serde's design to solve rustc's problem (which might've changed now? this discussion was surely more than half a year ago)</p>



<a name="163580465"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580465" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580465">(Apr 17 2019 at 17:05)</a>:</h4>
<p>but definitely, I think we should converge somehow with this <span aria-label="thumbs up" class="emoji emoji-1f44d" role="img" title="thumbs up">:thumbs_up:</span></p>



<a name="163580540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580540">(Apr 17 2019 at 17:06)</a>:</h4>
<p>I guess, we can wrap up the discussion?</p>



<a name="163580558"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580558" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580558">(Apr 17 2019 at 17:07)</a>:</h4>
<p>yeah</p>



<a name="163580579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580579">(Apr 17 2019 at 17:07)</a>:</h4>
<p>as you're saying, I believe IPC overhead is negligible</p>



<a name="163580593"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580593" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580593">(Apr 17 2019 at 17:07)</a>:</h4>
<p>I say we do it and measure overhead then, if any</p>



<a name="163580608"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580608" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580608">(Apr 17 2019 at 17:07)</a>:</h4>
<p>sgmt!</p>



<a name="163580612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580612">(Apr 17 2019 at 17:07)</a>:</h4>
<p>however I believe we can actually profit off this if we switch to binary serialization</p>



<a name="163580753"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580753" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580753">(Apr 17 2019 at 17:09)</a>:</h4>
<p>yeah, that was my though as well: in general, by teasing apart things and creating boundaries, you can easier optimize stuff!</p>
<p>One hope I have for my lexer work is to (in the far-future) generate the lexer as a giant utf-8-decoding state machine. Should be much easier once lexer is independent of ParseSess and the rest of the jungle :D</p>



<a name="163580755"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580755" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580755">(Apr 17 2019 at 17:09)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> I'm really sorry for constantly putting off work for 2.0 -  let me work on this first, seeing as there are no people who know their way around save-analysis, short of nrc <span aria-label="smiley" class="emoji emoji-1f603" role="img" title="smiley">:smiley:</span></p>



<a name="163580765"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580765" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580765">(Apr 17 2019 at 17:09)</a>:</h4>
<p>haha, yeah</p>



<a name="163580787"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580787" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580787">(Apr 17 2019 at 17:09)</a>:</h4>
<p>I'm really interested in the lexer-as-a-library, please let me know if I can help</p>



<a name="163580876"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580876" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580876">(Apr 17 2019 at 17:10)</a>:</h4>
<p>I'd really like to start librarifying things and splitting them off or even sharing, soon <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="163580880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580880">(Apr 17 2019 at 17:10)</a>:</h4>
<p>yeah, that PR about toolstate is sad :( </p>
<p>I guess I might be able to put more work into the overall tooling after my Rust course ends</p>



<a name="163580924"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163580924" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163580924">(Apr 17 2019 at 17:11)</a>:</h4>
<p>JFYI, the lexer work is here: <a href="https://github.com/rust-lang/rust/pull/59706" target="_blank" title="https://github.com/rust-lang/rust/pull/59706">https://github.com/rust-lang/rust/pull/59706</a></p>



<a name="163581038"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163581038" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163581038">(Apr 17 2019 at 17:12)</a>:</h4>
<p>oh, this is actually closer than I thought, from what I can understand from the comments</p>



<a name="163581044"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163581044" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163581044">(Apr 17 2019 at 17:12)</a>:</h4>
<p>nice! <span aria-label="tada" class="emoji emoji-1f389" role="img" title="tada">:tada:</span></p>



<a name="163581509"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163581509" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163581509">(Apr 17 2019 at 17:17)</a>:</h4>
<p>Serde in the compiler discussion: <a href="#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler/near/163581456" title="#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler/near/163581456">https://rust-lang.zulipchat.com/#narrow/stream/131828-t-compiler/topic/serde.20in.20the.20compiler/near/163581456</a></p>



<a name="163602941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163602941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163602941">(Apr 17 2019 at 21:37)</a>:</h4>
<p>What's the advantage of rust-analyzer using save analysis?</p>



<a name="163606010"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163606010" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163606010">(Apr 17 2019 at 22:20)</a>:</h4>
<p>The data comes from the compiler so it should be more complete</p>



<a name="163606018"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163606018" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163606018">(Apr 17 2019 at 22:21)</a>:</h4>
<p>This is nice because in theory it should handle (proc) macro expansions and whatnot</p>



<a name="163606111"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163606111" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163606111">(Apr 17 2019 at 22:22)</a>:</h4>
<p>and by bridging the gap I think we get a more featureful(?) product and the work can improve the save-analysis backend which is important in itself for potential code indexer usage or in the future to make rustc handle lazy/on-demand work better</p>



<a name="163606130"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163606130" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Igor Matuszewski <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163606130">(Apr 17 2019 at 22:22)</a>:</h4>
<p><span class="user-mention" data-user-id="133169">@matklad</span> <a href="https://github.com/rust-lang/rust/pull/60053" target="_blank" title="https://github.com/rust-lang/rust/pull/60053">https://github.com/rust-lang/rust/pull/60053</a> it seems that... serde just works? this would be terrific</p>



<a name="163606664"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163606664" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Nick Lawrence <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163606664">(Apr 17 2019 at 22:32)</a>:</h4>
<p>for newer rust-folk, whats a more laymans explanation of the benefits?</p>



<a name="163630232"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163630232" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163630232">(Apr 18 2019 at 07:54)</a>:</h4>
<p>Rust analyzer currently works by re-implementing part of the compiler like parsing and type inference. Save-analysis works by asking, e.g, type inference info from the existing rustc. First approach is faster and scales better (due to careful choice of ide-oriented high-level architecture), but it handles only a fraction of the language now.</p>



<a name="163650181"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163650181" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163650181">(Apr 18 2019 at 13:17)</a>:</h4>
<p>so is this like a temporary thing until rls 2.0 can share code with the compiler for macro expansion, name resolution and so on?</p>



<a name="163650397"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163650397" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> matklad <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163650397">(Apr 18 2019 at 13:19)</a>:</h4>
<p>yeah!</p>



<a name="163650569"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163650569" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163650569">(Apr 18 2019 at 13:21)</a>:</h4>
<p>and even if it's able to read the analysis files, rust analyzer doesn't know what to do with them?</p>



<a name="163650579"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/RLS%201.0%20--%20RLS%202.0%20bridge/near/163650579" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Laurențiu <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/RLS.201.2E0.20--.20RLS.202.2E0.20bridge.html#163650579">(Apr 18 2019 at 13:21)</a>:</h4>
<p>right now, at least</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>